package com.aidl.demo;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.os.RemoteException;

import androidx.annotation.Nullable;

public class UpdateService extends Service {
    private String name;

    @Nullable
    @Override
    public IBinder onBind(Intent intent) {
        name = intent.getStringExtra("name");
        return mStub;
    }

    IMyAidlInterface.Stub mStub = new IMyAidlInterface.Stub() {
        @Override
        public void basicTypes(int anInt, long aLong, boolean aBoolean, float aFloat, double aDouble, String aString) throws RemoteException {
        }

        @Override
        public String getName() throws RemoteException {
            return name;
        }
    };
}
